package cn.xpg.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import cn.xpg.dao.ProductfaultMapper;
import cn.xpg.entity.Productfault;
import cn.xpg.service.ProductfaultService;

@Service("productfaultService")
public class ProductfaultServiceImpl implements ProductfaultService {

	@Resource(name = "productfaultMapper")
	private ProductfaultMapper productfaultMapper;

	@Override
	public int addProductfault(Productfault productfault) {
		// TODO Auto-generated method stub
		int count = productfaultMapper.addProductfault(productfault);
		return count;
	}

	@Override
	public int deleteProductfault(int productfault_id) {
		// TODO Auto-generated method stub
		int count = productfaultMapper.deleteProductfault(productfault_id);
		return count;
	}

	@Override
	public Productfault getProductfaultId(int productfault_id) {
		// TODO Auto-generated method stub
		Productfault productfault = productfaultMapper.getProductfaultId(productfault_id);
		return productfault;
	}

	@Override
	public int updateProductfault(Productfault productfault) {
		// TODO Auto-generated method stub
		int count = productfaultMapper.updateProductfault(productfault);
		return count;
	}

	@Override
	public int getProductfaultCount(String productfault_name) {
		// TODO Auto-generated method stub
		int count = Integer.valueOf(productfaultMapper.getProductfaultCount(productfault_name).toString());
		return count;
	}

	@Override
	public List<Productfault> getProductfaultList(String productfault_name, int currentPageNo, int pageSize) {
		// TODO Auto-generated method stub
		List<Productfault> list = productfaultMapper.getProductfaultList(productfault_name, currentPageNo, pageSize);
		return list;
	}
}
